﻿namespace WebPacker.Compressors
{
	using System.IO;
	using System.Text;

	public sealed class NullCompressor : ICompressor
	{
		public NullCompressor()
		{
			Encoding = Encoding.UTF8;
		}

		public string Name
		{
			get { return string.Empty; }
		}

		public Encoding Encoding { get; set; }

		public bool Accept(string acceptEncoding)
		{
			return true;
		}

		public void Compress(string content, Stream targetStream)
		{
			var bytes = Encoding.GetBytes(content);
			targetStream.Write(bytes, 0, bytes.Length);
		}
	}
}
